UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uk+0jXiL9F9Ywxjgtct3BDZtNFiCbYgbVaNNJIGHNpA=' 
WHERE 
  key_id = '13c1aac3568812c3f79ae968625213c1af9ea3965cf36ff6651bbc2d69b5f577' 
  AND (
    token = 'uk+0jXiL9F9Ywxjgtct3BDZtNFiCbYgbVaNNJIGHNpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018