UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eRXFicQwUQG7TsrV2YypXzo1rDYFaTuGL6iZ3VcdkmY='
WHERE
key_id = '3fbb4feb36710ad500f98e542d1bab89626b6dbcb3d9493a31bad9467c767092'
AND (
token = 'eRXFicQwUQG7TsrV2YypXzo1rDYFaTuGL6iZ3VcdkmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)