UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yxGeJBlYRQgXDwh8xw0iDA2n3v8FXSsAh2mmIHLr6Y8='
WHERE
key_id = 'c8384fa26f99b6946aa741ec70f53eac843ba3b5c6aad3286db13fd6d2e47ebc'
AND (
token = 'yxGeJBlYRQgXDwh8xw0iDA2n3v8FXSsAh2mmIHLr6Y8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)