UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xPxyjMh8usbebAnn+tB0ZVtQYvfYC9ZmjTpu7idgWec=' 
WHERE 
  key_id = '6b4f543ecf9938c55d7e8a541ab35dce806bf46573d1431c467e7fd5c23a710b' 
  AND (
    token = 'xPxyjMh8usbebAnn+tB0ZVtQYvfYC9ZmjTpu7idgWec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013