UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HlZ4iLKXsbuv0qbLl3y3C1rFQsolP1fpT6mvA5zcGSQ=' 
WHERE 
  key_id = '61bc6c717886d22288080aeb4bdb7e92231cb9248fbc6deee0ea38c9f9510e78' 
  AND (
    token = 'HlZ4iLKXsbuv0qbLl3y3C1rFQsolP1fpT6mvA5zcGSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017