UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YySZgvPnBrsqCncsp2vGJYx1WxhTbibPgVxkUoHWRfo='
WHERE
key_id = '85b3b6cdd2f3eb8e5f388fe71a4e5bc3c9f43e50a9f742a1c99db276e4d0bb70'
AND (
token = 'YySZgvPnBrsqCncsp2vGJYx1WxhTbibPgVxkUoHWRfo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)