UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PaSBi65Inp967SSAhe5PfoneCBX6WlrRQ25vBDgXWQc='
WHERE
key_id = '49785e3a2984a481c013f099d1f90b9225dadfd6d7e3a3094d3ae819f7c97744'
AND (
token = 'PaSBi65Inp967SSAhe5PfoneCBX6WlrRQ25vBDgXWQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)