UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A+bMTorJnJIwOC8bE4gKK73KXdNmSnk6a6CTrVxJ45o='
WHERE
key_id = '2cf080cf1c05e543e1b9e21cd425f4c42dda45ec59ef016d96659e7fbeb40015'
AND (
token = 'A+bMTorJnJIwOC8bE4gKK73KXdNmSnk6a6CTrVxJ45o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)