UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RcLkSCQHVfPMOvV68nUn9Xo+KiqZjyzEbIWu3sY5Pxw=' 
WHERE 
  key_id = '8274a6e7344c5f9251f56985735d91bf9dbdc1c94170eb59ea22ea9ad4a91968' 
  AND (
    token = 'RcLkSCQHVfPMOvV68nUn9Xo+KiqZjyzEbIWu3sY5Pxw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034