UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z2UxYZhmxjj8sX4+gaa8eqboYcH4SR538X5fxzXficg='
WHERE
key_id = '134edc06a71e25828cc66ea082be81bc2b16c4ad89ccf73b642e40e9e217656a'
AND (
token = 'z2UxYZhmxjj8sX4+gaa8eqboYcH4SR538X5fxzXficg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)