UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LrIQXr3XIII838N0jEqfcy74NxJedO9xMJvcakrPCSw='
WHERE
key_id = '486c3553669ce5e2fa29605c02a54695c7d8974596ad1c3db718204f4ecdf310'
AND (
token = 'LrIQXr3XIII838N0jEqfcy74NxJedO9xMJvcakrPCSw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)