UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZXChCChkB3C3rpyiGmQoKoo/WYvhzoOyt9ZJ6VfcFn0=' 
WHERE 
  key_id = '33b81a1d9fcde6bbdcab793139ed64cd9c646b695b1cfb0e940a5af913fb5e75' 
  AND (
    token = 'ZXChCChkB3C3rpyiGmQoKoo/WYvhzoOyt9ZJ6VfcFn0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032