UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GISVqAsHoqdhz9322TZK0ZhQbIJGyWuW7X68SMuB3xY='
WHERE
key_id = '9977e1495b29b05bfdc310ca4edf23f027e5b9b4c3569fd458cedaf659a967e3'
AND (
token = 'GISVqAsHoqdhz9322TZK0ZhQbIJGyWuW7X68SMuB3xY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)