UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qkVIpKZGdS0EVldYkfX3IXFj3HjLgLwZAu7Xtw1T7rU=' 
WHERE 
  key_id = '702be3a2ddfafab79c14eb85cb14e39846dedf36ff59023fb116e27c97f70e29' 
  AND (
    token = 'qkVIpKZGdS0EVldYkfX3IXFj3HjLgLwZAu7Xtw1T7rU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042