UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vW5MhG+coaF8Mp2QkcnFKAhmdLbw9Ip2yzWNVmvurNo=' 
WHERE 
  key_id = 'c4c551247e0443ed3785b5827eae8fd085e874af4630654a1ae5a304535062ec' 
  AND (
    token = 'vW5MhG+coaF8Mp2QkcnFKAhmdLbw9Ip2yzWNVmvurNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021