UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'grB5B/c+NPq4SvEm32FozQNSW6OlKWOLuB4Iy2Zfe9c='
WHERE
key_id = '0cf5f485f5b2e5c11f6439745eebc70e1634f54463543194c6dee817ec14ccc6'
AND (
token = 'grB5B/c+NPq4SvEm32FozQNSW6OlKWOLuB4Iy2Zfe9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)