UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1J5ySJ4o5jz4xpdSVVwZj0gla93rsH4cXArzojHUi2w='
WHERE
key_id = 'a3b52b89f76dfdbb0d7f282c5bf6764d75dcb0c13ee5408fa9802480944a8bd8'
AND (
token = '1J5ySJ4o5jz4xpdSVVwZj0gla93rsH4cXArzojHUi2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)