UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TmNuv8fazevkUNY5ScMH+dFEi01MsNtHWCLo8T2MSNQ='
WHERE
key_id = '14ab0f832c477391e202e113b859e69da37ad694c56c342667edd8505fc4e81b'
AND (
token = 'TmNuv8fazevkUNY5ScMH+dFEi01MsNtHWCLo8T2MSNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)