UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wiwA4jByA+qJ8Awag/9As5OCtfNQXkdDJxq/Q4A4D00='
WHERE
key_id = '3dc113f5a63145d977e60f9194e50950c768c2adbf127daa73f8945530b02f60'
AND (
token = 'wiwA4jByA+qJ8Awag/9As5OCtfNQXkdDJxq/Q4A4D00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)