UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/1zqsyrYRmm2T9JRkqrEzMu+Bn2NkwN9TBWtDSrFBu0=' 
WHERE 
  key_id = 'bf27e9a7d9c064611a45a29b5062ad555c5679303ed6744c3e1945bf6eb39e4a' 
  AND (
    token = '/1zqsyrYRmm2T9JRkqrEzMu+Bn2NkwN9TBWtDSrFBu0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038