UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H4Eqa7Urh6JwjSK5XOK+LPpH5Tnrq4m0roy40aJbB9g='
WHERE
key_id = 'bec4aa917619da90fc630899fb1782e7ac8c578b0e881335db98694eed0373ed'
AND (
token = 'H4Eqa7Urh6JwjSK5XOK+LPpH5Tnrq4m0roy40aJbB9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)