UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hIfV32pLkjSd+gpzPqKRSsJAOjauUdGUQl7wAe4jtvM='
WHERE
key_id = '42077fa1007adfa61c2548ca49f460b9e39027a50efbe9d73ba2eadca700643f'
AND (
token = 'hIfV32pLkjSd+gpzPqKRSsJAOjauUdGUQl7wAe4jtvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)