UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H5n4LgQ/uy0AKgmo9mxYbnYNTmVs5Mm3nyrpfJcKzHs='
WHERE
key_id = '4e1a7f2b3ba1297467ddfacc4ccbcc7044812b1b1bb744e6caeaf047d4ae94eb'
AND (
token = 'H5n4LgQ/uy0AKgmo9mxYbnYNTmVs5Mm3nyrpfJcKzHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)