UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FLm/EOOkhj5SSU64Ow8P3uYnfPCgHzZ9Ar9WaOUHC4c='
WHERE
key_id = 'e8ef51bb544ade6c696ef0a1874d677046f3d63d6fb6de305943f432dc58cd9a'
AND (
token = 'FLm/EOOkhj5SSU64Ow8P3uYnfPCgHzZ9Ar9WaOUHC4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)