UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RiuH4L7ym7VXYnaVUAQesrHToSqdUdgnWTCUr5z+azE='
WHERE
key_id = '6119868143d7e7e5034a5d8e48741d4ad61245c25b23878a41bcd55bf55f5fb6'
AND (
token = 'RiuH4L7ym7VXYnaVUAQesrHToSqdUdgnWTCUr5z+azE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)