UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pmf/0pK6qfQWfYPcnJLNI30rlZZMBHP2dKP80bwVqY0=' 
WHERE 
  key_id = 'd4842c8ec5ea76230a1707ce262f1eb9f7e351ac766cfe530cc25e010edf2c38' 
  AND (
    token = 'pmf/0pK6qfQWfYPcnJLNI30rlZZMBHP2dKP80bwVqY0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034