UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'siRmH/iitn5OAnL5idTARlMdsotJsj8O4h/xz0cR8GY=' 
WHERE 
  key_id = 'aac1ffc8edaf287c99e19a5dceab3bfe1c7977870c61b3fe42fd93a85b5865cb' 
  AND (
    token = 'siRmH/iitn5OAnL5idTARlMdsotJsj8O4h/xz0cR8GY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020