UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fWbkT8aWVuQ/sEwnPyKhLiHik7MsUlSJXgpGQLaoWY0='
WHERE
key_id = 'def5dc762c20b9d0e39c90d32ae0fcdd56afd187d7c62c0a498d5bc3c0102b50'
AND (
token = 'fWbkT8aWVuQ/sEwnPyKhLiHik7MsUlSJXgpGQLaoWY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)