UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SiypvaLyhZJwGdyfcyganqQdSzUbO3W3TvnlrqRODv4='
WHERE
key_id = '19afae4f6a3bd6821af9c8332ef0efcb5853bcb962679f18d82b87f0c8e0b651'
AND (
token = 'SiypvaLyhZJwGdyfcyganqQdSzUbO3W3TvnlrqRODv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)