UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k08UYjnxh0zWqqXOq1UU6T2YECyhcLyjnZ59JGrRUWI=' 
WHERE 
  key_id = 'f70d7ea9f8eea2e8892699d9c832fb4463d869eea76efa734eb8fdfc2bb55d9c' 
  AND (
    token = 'k08UYjnxh0zWqqXOq1UU6T2YECyhcLyjnZ59JGrRUWI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025