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