UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3rBy7BFXYdZypEpo65od297/mq47+HpjNSFoD1ikh1s=' 
WHERE 
  key_id = '6c6ca46a41e50935b26257ace5aecf2ba6aaefc8a3c5734b5f807431fc0fa4fc' 
  AND (
    token = '3rBy7BFXYdZypEpo65od297/mq47+HpjNSFoD1ikh1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045