UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RAETvZ/JW49/h/qDjbWhsq9vIvGSukwhQXC+rHDIE6I=' 
WHERE 
  key_id = '07c1fe2c2e28799019837787ea3712f38550c8b4404c7928de37ff220313cb4e' 
  AND (
    token = 'RAETvZ/JW49/h/qDjbWhsq9vIvGSukwhQXC+rHDIE6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031