UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qRGzTGqIBPb+Lfb7Yc7UpllhwFzFxyXjGncxSzGMhHE='
WHERE
key_id = 'b55f0de6ac513a4ea4b21fe452eb017c4d202b05654c49e3fc4b2b06d41767be'
AND (
token = 'qRGzTGqIBPb+Lfb7Yc7UpllhwFzFxyXjGncxSzGMhHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)