UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8oVHzvCB2ZnVHGML89OJVAF0kjdcQHAQ8cDHWHDu34c=' 
WHERE 
  key_id = 'eafbfa6c54a7c8df8874a02c8a0eebb0195bb9ccb410b4d12e8dec23b1d359d4' 
  AND (
    token = '8oVHzvCB2ZnVHGML89OJVAF0kjdcQHAQ8cDHWHDu34c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022