UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O6ZH5+sJSvQSvRpeW/gZuD2RdHtvdCS8yvTJs7wEo/c=' 
WHERE 
  key_id = 'c47ade7853554835c19f9e56fa3505f5de6f73837e0e601fb9c569efa098181c' 
  AND (
    token = 'O6ZH5+sJSvQSvRpeW/gZuD2RdHtvdCS8yvTJs7wEo/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031