UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sU/5VHs0GemjmhXb8XXaPlwR03xHqx84V/eGIMu48XU='
WHERE
key_id = 'dc74bbf3bf036ba2b658383391ee373e8651ae9dd85b572d11d0f70ea25eb9bd'
AND (
token = 'sU/5VHs0GemjmhXb8XXaPlwR03xHqx84V/eGIMu48XU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)