UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lBI7e6u2V9KT5YwxteexJMkAXUVVrA8jUa1AOwZshwg='
WHERE
key_id = '13eb35f87e52cd253ab85d56619749aa2151aaa8ca18843f4edfb0eb2c2f2457'
AND (
token = 'lBI7e6u2V9KT5YwxteexJMkAXUVVrA8jUa1AOwZshwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)